# coding=utf-8
from django.contrib.auth.decorators import login_required
from django.urls import path,re_path
from . import views # 导入模块

urlpatterns = [
    re_path('^register/$',views.RegisterView.as_view()), # 用户注册
    re_path('^usernames/(?P<username>[a-zA-Z]{5,8})/count/$',views.UsernameCount.as_view()), # 查询用户有没有重复的进行登录
    re_path('^logout/$',views.LogOut.as_view()), # 用户退出登录
    re_path('^phones/(?P<phone>1[35789]\d{9})/count/$', views.PhoneCount.as_view()),  # 查询用户手机号有没有重复注册
    re_path('^login/$', views.LoginView.as_view()),  # 用户登录
    re_path('^usercenter/$', login_required(views.UserCenterView.as_view())),  # 用户中心（用户是否登录）
]








